package com.four.peoplemanage.brcards.controller;

import com.four.peoplemanage.brcards.entity.Brcards;
import com.four.peoplemanage.brcards.service.BrcardsService;
import com.four.peoplemanage.common.bean.ResponseData;
import com.four.peoplemanage.common.controller.BaseController;
import com.four.peoplemanage.holiday.entity.Holiday;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/brcards")
public class BrcardsController extends BaseController {

    @Autowired
    private BrcardsService brcardsService;

    //查看
    @GetMapping("/canAll")
    public ResponseData<Object> getBrcards(
            @RequestParam("pageNum") int pageNum,
            @RequestParam("pageSize") int pageSize
    ){
        return returnObject(brcardsService.getOnrePage(pageNum,pageSize));
    }

    //添加
    @PostMapping("/add")
    public ResponseData<Boolean> add(Brcards brcards){
        return returnBoolean(brcardsService.insert(brcards));
    }

}
